# 使用 while 循环实现一个范围在 0-10 之间的猜数游戏
import random
num = 1
computer = random.randint(0, 10)
print(f'电脑的数字是{computer}')
while True:
    player = int(input('请输入您猜的数字:'))
    if player > computer:
        print('猜大了')
    elif player < computer:
        print('猜小了')
    elif player == computer:
        print(f'猜对了,猜了{num}次')
        break
    num += 1
